<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>量子投票系统</title>
    <style>
        .question-number {
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 24px;
    text-align: center;
    background: rgba(15, 240, 252, 0.2);
    color: var(--primary-color);
    border-radius: 50%;
    margin-right: 12px;
    font-size: 0.8em;
    border: 1px solid var(--primary-color);
    box-shadow: 0 0 5px rgba(0, 255, 252, 0.5);
    transition: all 0.3s;
}

.poll-link:hover .question-number {
    transform: scale(1.1);
    background: rgba(15, 240, 252, 0.4);
    box-shadow: 0 0 10px rgba(0, 255, 252, 0.8);
}
        :root {
            --primary-color: #0ff0fc;
            --secondary-color: #ff2a6d;
            --dark-bg: #0d0221;
            --darker-bg: #070116;
            --text-color: #d1f7ff;
            --border-radius: 4px;
            --box-shadow: 0 0 15px rgba(0, 255, 252, 0.3);
            --neon-glow: 0 0 10px rgba(0, 255, 252, 0.8), 0 0 20px rgba(0, 255, 252, 0.6);
        }

        body {
            font-family: 'Orbitron', 'Segoe UI', sans-serif;
            line-height: 1.6;
            color: var(--text-color);
            max-width: 800px;
            margin: 0 auto;
            padding: 20px;
            background-color: var(--dark-bg);
            background-image: 
                radial-gradient(circle at 25% 25%, rgba(15, 240, 252, 0.1) 0%, transparent 50%),
                radial-gradient(circle at 75% 75%, rgba(255, 42, 109, 0.1) 0%, transparent 50%);
            position: relative;
            overflow-x: hidden;
        }

        body::before {
            content: "";
            position: absolute;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: 
                linear-gradient(135deg, transparent 49.5%, var(--primary-color) 49.5%, var(--primary-color) 50.5%, transparent 50.5%),
                linear-gradient(45deg, transparent 49.5%, var(--primary-color) 49.5%, var(--primary-color) 50.5%, transparent 50.5%);
            background-size: 30px 30px;
            opacity: 0.05;
            pointer-events: none;
            z-index: -1;
        }

        h1 {
            color: var(--primary-color);
            text-align: center;
            margin-bottom: 30px;
            font-weight: 700;
            text-shadow: 0 0 10px rgba(0, 255, 252, 0.5);
            letter-spacing: 2px;
            position: relative;
            padding-bottom: 15px;
        }

        h1::after {
            content: "";
            position: absolute;
            bottom: 0;
            left: 50%;
            transform: translateX(-50%);
            width: 100px;
            height: 3px;
            background: linear-gradient(90deg, transparent, var(--primary-color), transparent);
            box-shadow: var(--box-shadow);
        }

        .poll-container {
            background: rgba(13, 2, 33, 0.7);
            border-radius: var(--border-radius);
            box-shadow: var(--box-shadow);
            padding: 25px;
            margin-bottom: 20px;
            border: 1px solid rgba(0, 255, 252, 0.2);
            backdrop-filter: blur(5px);
            transition: all 0.3s;
            position: relative;
            overflow: hidden;
        }

        .poll-container:hover {
            box-shadow: var(--neon-glow);
            transform: translateY(-5px);
            border-color: var(--primary-color);
        }

        .poll-container::before {
            content: "";
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: linear-gradient(
                to bottom right,
                transparent 45%,
                rgba(0, 255, 252, 0.1) 50%,
                transparent 55%
            );
            transform: rotate(45deg);
            pointer-events: none;
        }

        .poll-list {
            list-style: none;
            padding: 0;
            margin: 0;
        }

        .poll-item {
            margin-bottom: 15px;
            position: relative;
        }

        .poll-item:last-child {
            margin-bottom: 0;
        }

        .poll-link {
            display: block;
            padding: 15px 20px;
            background-color: rgba(15, 240, 252, 0.1);
            color: var(--text-color);
            text-decoration: none;
            border-radius: var(--border-radius);
            transition: all 0.3s;
            font-weight: 500;
            border: 1px solid rgba(0, 255, 252, 0.3);
            position: relative;
            overflow: hidden;
        }

        .poll-link:hover {
            background-color: rgba(15, 240, 252, 0.2);
            box-shadow: var(--neon-glow);
            border-color: var(--primary-color);
        }

        .poll-link::before {
            content: "";
            position: absolute;
            top: 0;
            left: -100%;
            width: 100%;
            height: 100%;
            background: linear-gradient(
                90deg,
                transparent,
                rgba(0, 255, 252, 0.2),
                transparent
            );
            transition: 0.5s;
        }

        .poll-link:hover::before {
            left: 100%;
        }

        .poll-date {
            float: right;
            font-size: 0.8em;
            opacity: 0.8;
            color: var(--secondary-color);
            font-family: 'Courier New', monospace;
        }

        .no-polls {
            text-align: center;
            padding: 30px;
            background-color: rgba(7, 1, 22, 0.7);
            border-radius: var(--border-radius);
            color: var(--text-color);
            border: 1px dashed rgba(0, 255, 252, 0.3);
        }

        .no-polls button {
            background: rgba(15, 240, 252, 0.1);
            color: var(--primary-color);
            border: 1px solid var(--primary-color);
            padding: 8px 20px;
            border-radius: var(--border-radius);
            cursor: pointer;
            margin-top: 15px;
            transition: all 0.3s;
            font-family: 'Orbitron', sans-serif;
        }

        .no-polls button:hover {
            background: rgba(15, 240, 252, 0.3);
            box-shadow: 0 0 10px rgba(0, 255, 252, 0.5);
        }

        .loading {
            text-align: center;
            padding: 30px;
            display: none;
            color: var(--primary-color);
        }

        .loading::after {
            content: "...";
            animation: dots 1.5s infinite;
        }

        @keyframes dots {
            0%, 20% { content: "."; }
            40% { content: ".."; }
            60%, 100% { content: "..."; }
        }

        @media (max-width: 600px) {
            body {
                padding: 15px;
            }
            
            .poll-link {
                padding: 12px 15px;
                font-size: 0.9em;
            }
        }

        /* 添加一些科技感元素 */
        .tech-corner {
            position: absolute;
            width: 30px;
            height: 30px;
            border-color: var(--primary-color);
            border-style: solid;
            border-width: 0;
            opacity: 0.7;
        }

        .tech-corner-tl {
            top: 10px;
            left: 10px;
            border-top-width: 2px;
            border-left-width: 2px;
        }

        .tech-corner-tr {
            top: 10px;
            right: 10px;
            border-top-width: 2px;
            border-right-width: 2px;
        }

        .tech-corner-bl {
            bottom: 10px;
            left: 10px;
            border-bottom-width: 2px;
            border-left-width: 2px;
        }

        .tech-corner-br {
            bottom: 10px;
            right: 10px;
            border-bottom-width: 2px;
            border-right-width: 2px;
        }
    </style>
    <link href="https://fonts.googleapis.com/css2?family=Orbitron:wght@400;500;700&display=swap" rel="stylesheet">
</head>
<body>
    <h1>投票应用</h1>
    

    <div style="text-align: right; margin-bottom: 20px;">
        <a href="/admin" style="color: var(--secondary-color); text-decoration: none; border: 1px solid var(--secondary-color); padding: 5px 15px; border-radius: var(--border-radius); transition: all 0.3s;">
            管理员入口
        </a>
    </div>
    <div id="poll-list-container">
        {% if latest_question_list %}
            <ul class="poll-list">
                {% for question in latest_question_list %}
<li class="poll-item">
    <div class="tech-corner tech-corner-tl"></div>
    <div class="tech-corner tech-corner-tr"></div>
    <div class="tech-corner tech-corner-bl"></div>
    <div class="tech-corner tech-corner-br"></div>
    <a href="{% url 'polls:detail' question.id %}" class="poll-link">
        <span class="question-number">{{ forloop.counter }}</span>
        {{ question.question_text }}
        <span class="poll-date">
            {% if question.pub_date %}
                {{ question.pub_date|date:"Y-m-d" }}
            {% endif %}
        </span>
        <div class="poll-tags">
            {% for tag in question.tags.all %}
                <span class="tag">{{ tag.name }}</span>
            {% endfor %}
        </div>
    </a>
</li>
{% endfor %}
            </ul>
        {% else %}
            <div class="no-polls">
                <p>数据库未检测到投票数据</p>
                <button onclick="location.reload()">重新扫描</button>
            </div>
        {% endif %}
    </div>

    <div class="loading" id="loading">
        系统加载中
    </div>

    <script>
        // 添加科技感交互效果
        document.addEventListener('DOMContentLoaded', function() {
            const links = document.querySelectorAll('.poll-link');
            const containers = document.querySelectorAll('.poll-container, .poll-item');
            
            // 添加鼠标悬停时的光效
            links.forEach(link => {
                link.addEventListener('mouseenter', function() {
                    this.style.boxShadow = '0 0 15px rgba(0, 255, 252, 0.8)';
                });
                
                link.addEventListener('mouseleave', function() {
                    this.style.boxShadow = '';
                });
                
                link.addEventListener('click', function(e) {
                    document.getElementById('loading').style.display = 'block';
                });
            });
            
            // 为容器添加随机闪烁效果
            containers.forEach(container => {
                setInterval(() => {
                    if (Math.random() > 0.95) {
                        container.style.boxShadow = '0 0 20px rgba(255, 42, 109, 0.8)';
                        setTimeout(() => {
                            container.style.boxShadow = '';
                        }, 300);
                    }
                }, 3000);
            });
            
            // 模拟数据加载效果
            setTimeout(() => {
                document.getElementById('loading').style.display = 'none';
            }, 1500);
        });
    </script>
</body>
</html>